import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.2

ApplicationWindow {
    title: qsTr("Hello World")
    width: 640
    height: 480
    visible: true
    TextInput{
        id: textInput
        anchors.centerIn: parent
        width: 120; height: 30
        font.pixelSize: 20
        //validator: IntValidator{ top: 15; bottom: 6}
        focus: true
        echoMode: TextInput.Password
        passwordCharacter: "#"
        onEditingFinished: {
            console.log(textInput.text);
            if (textInput.text == "exit")
                Qt.quit();
        }
    }

    TextField{
        style: TextFieldStyle{
            textColor: "grey"
            background: Rectangle{
                radius: 2
                implicitHeight: 24
                implicitWidth: 100
                border.color: "lightgreen"
                border.width: 1
            }
        }
    }

    TextArea{
        id: textView
        anchors.top: textInput.bottom
        anchors.horizontalCenter: textInput.horizontalCenter
        wrapMode: TextEdit.WordWrap
        style: TextAreaStyle{
            backgroundColor: "black"
            textColor: "green"
            selectionColor: "steelblue"
            selectedTextColor: "#a00000"
        }
    }
}
